package com.douban.crawl.db;

import com.douban.crawl.model.BookComment;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class BookCommentDao {

    private BaseDao baseDao = new BaseDao();

    public void save(BookComment bookComment) {
        baseDao.insert(bookComment);
    }

    public List<BookComment> getList(String bookId) {
        Map<String, String> queryMap = new HashMap<>();
        queryMap.put("book_id", bookId);
        return baseDao.getList(BookComment.class, queryMap);
    }

    public List<BookComment> getList(String bookId, Integer limitSize) {
        Map<String, String> queryMap = new HashMap<>();
        queryMap.put("book_id", bookId);
        return baseDao.getList(BookComment.class, queryMap, limitSize);
    }
}
